/**
 * 
 *德邦证券股份有限公司
 *
 * Copyright (c) 1996-2013 Tebon, Inc. All rights reserved.
 */
package com.saturn.config.server.base;

import java.io.Serializable;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 
 * Description: <p>基础对象继承类</p>
 * Content Desc:<p>
 * <p>
 *  持久化基类，采用java.lang.ref包的内省机制覆盖父类的toString()、equals(Object o)、hasCode()方法<br/>
 *  hibernate持久层调用的方法
 *
 * @author tanks
 * @version 1.0, 2014-7-15
 * @since sirius-core
 *
 */
@SuppressWarnings("serial")
public abstract class BaseObject implements Serializable {

	/**
     * 覆盖父类的toString()
     * @return POJO子类详细信息
     */
    public String toString() {
        return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
    }

    /**
     * 覆盖父类的equals(Object o)方法
     */
    public boolean equals(Object o) {
        return EqualsBuilder.reflectionEquals(this, o);
    }
    
    /**
     * 覆盖父类的hasCode()方法
     */
    public int hashCode() {
    	return HashCodeBuilder.reflectionHashCode(this);
    }
  
}
